﻿using System;
using Castle.ActiveRecord;

namespace WeatherModel
{
    /// <summary>
    /// 天气时间
    /// </summary>
    [ActiveRecord]
    [Serializable]
    public class WeatherTime : ARBase<WeatherTime>
    {
        public WeatherTime()
        {
        }

        public WeatherTime(int iChannel)
        {
            Channel = iChannel;
            RecodeDate = DateTime.Now;
        }

        /// <summary>
        /// 温度最大
        /// </summary>
        [Property]
        public double TemperatureMax { get; set; }

        /// <summary>
        /// 温度最大时间
        /// </summary>
        [Property]
        public DateTime TemperatureMaxTime { get; set; }

        /// <summary>
        /// 温度最小
        /// </summary>
        [Property]
        public double TemperatureMin { get; set; }

        /// <summary>
        /// 温度最小时间
        /// </summary>
        [Property]
        public DateTime TemperatureMinTime { get; set; }

        /// <summary>
        /// 湿度最大
        /// </summary>
        [Property]
        public double HumidityMax { get; set; }

        /// <summary>
        /// 湿度最大时间
        /// </summary>
        [Property]
        public DateTime HumidityMaxTime { get; set; }

        /// <summary>
        /// 湿度最小
        /// </summary>
        [Property]
        public double HumidityMin { get; set; }

        /// <summary>
        /// 湿度最小时间
        /// </summary>
        [Property]
        public DateTime HumidityMinTime { get; set; }

        /// <summary>
        /// 雨量最大
        /// </summary>
        [Property]
        public double RainMax { get; set; }

        /// <summary>
        /// 雨量最大时间
        /// </summary>
        [Property]
        public DateTime RainMaxTime { get; set; }

        /// <summary>
        /// 雨量最小
        /// </summary>
        [Property]
        public double RainMin { get; set; }

        /// <summary>
        /// 雨量最小时间
        /// </summary>
        [Property]
        public DateTime RainMinTime { get; set; }

        /// <summary>
        /// 风速最大
        /// </summary>
        [Property]
        public double WindMax { get; set; }

        /// <summary>
        /// 风速最大时间
        /// </summary>
        [Property]
        public DateTime WindMaxTime { get; set; }

        /// <summary>
        /// 风速最小
        /// </summary>
        [Property]
        public double WindMin { get; set; }

        /// <summary>
        /// 风速最小时间
        /// </summary>
        [Property]
        public DateTime WindMinTime { get; set; }

        /// <summary>
        /// 气压最大
        /// </summary>
        [Property]
        public double BarometerMax { get; set; }

        /// <summary>
        /// 气压最大时间
        /// </summary>
        [Property]
        public DateTime BarometerMaxTime { get; set; }

        /// <summary>
        /// 气压最小
        /// </summary>
        [Property]
        public double BarometerMin { get; set; }

        /// <summary>
        /// 气压最小时间
        /// </summary>
        [Property]
        public DateTime BarometerMinTime { get; set; }

        /// <summary>
        /// 记录小时
        /// </summary>
        [Property]
        public int RecodeHour { get; set; }

        /// <summary>
        /// 记录分钟
        /// </summary>
        [Property]
        public int RecodeMinute { get; set; }

        /// <summary>
        /// 记录日期
        /// </summary>
        [Property]
        public int RecodeDay { get; set; }

        private DateTime _RecodeDate;
        /// <summary>
        /// 记录时间
        /// </summary>
        [Property]
        public DateTime RecodeDate
        {
            get
            {
                return _RecodeDate;
            }
            set
            {
                _RecodeDate = value;
                RecodeDay = _RecodeDate.Year * 10000 + _RecodeDate.Month * 100 + _RecodeDate.Day;
                RecodeHour = _RecodeDate.Hour;
                RecodeMinute = _RecodeDate.Minute;
            }
        }

        /// <summary>
        /// 当前频道
        /// </summary>
        [Property]
        public int Channel { get; set; }


    }
}